package com.ccp.dev.workflow.model;

import com.ccp.dev.core.basic.model.BaseModel;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import javax.xml.bind.annotation.*;

/**
 * ClassDescribe:
 * 触发新流程配置 Model对象
 * @author :wangcheng
 * Date: 2019-07-12
 */
@XmlRootElement(name="bpmTriggerDef")
@XmlAccessorType(XmlAccessType.NONE)
public class BpmNewFlowTrigger extends BaseModel<BpmNewFlowTrigger> {
    /**
     * ID
     */
    @XmlAttribute
    protected String id;
    /**
     * 名字
     */
    @XmlAttribute
    protected String name;
    /**
     * 节点
     */
    @XmlAttribute
    protected String nodeId;
    /**
     * 触发动作
     */
    @XmlAttribute
    protected String action;
    /**
     * 流程key
     */
    @XmlAttribute
    protected String flowKey;
    /**
     * 被触发流程
     */
    @XmlAttribute
    protected String triggerFlowKey;
    @XmlAttribute
    protected String triggerFlowName;
    /**
     * 映射配置
     */
    @XmlElement
    protected String jsonMaping;
    /**
     * 触发表单jason
     */
    @XmlElement
    protected String triggerJson;
    /**
     * 描述
     */
    @XmlAttribute
    protected String note;

    public void setId(String id){
        this.id = id;
    }
    /**
     * 返回 ID
     * @return
     */
    public String getId() {
        return this.id;
    }
    public void setName(String name){
        this.name = name;
    }
    /**
     * 返回 名子
     * @return
     */
    public String getName() {
        return this.name;
    }

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public String getFlowKey() {
        return flowKey;
    }

    public void setFlowKey(String flowKey) {
        this.flowKey = flowKey;
    }

    public String getTriggerFlowKey() {
        return triggerFlowKey;
    }

    public void setTriggerFlowKey(String triggerFlowKey) {
        this.triggerFlowKey = triggerFlowKey;
    }

    public String getTriggerFlowName() {
        return triggerFlowName;
    }

    public void setTriggerFlowName(String triggerFlowName) {
        this.triggerFlowName = triggerFlowName;
    }

    public String getJsonMaping() {
        return jsonMaping;
    }

    public void setJsonMaping(String jsonMaping) {
        this.jsonMaping = jsonMaping;
    }


    public void setAction(String action){
        this.action = action;
    }
    /**
     * 返回 触发动作
     * @return
     */
    public String getAction() {
        return this.action;
    }

    public String getNote() {
        return note;
    }
    public void setNote(String note) {
        this.note = note;
    }

    public String getTriggerJson() {
        return triggerJson;
    }
    public void setTriggerJson(String triggerJson) {
        this.triggerJson = triggerJson;
    }
    /**
     * @see Object#equals(Object)
     */
    @Override
    public boolean equals(Object object)
    {
        if (!(object instanceof BpmNewFlowTrigger))
        {
            return false;
        }
        BpmNewFlowTrigger rhs = (BpmNewFlowTrigger) object;
        return new EqualsBuilder()
                .append(this.id, rhs.id)
                .append(this.name, rhs.name)
                .append(this.nodeId, rhs.nodeId)
                .append(this.action, rhs.action)
                .append(this.flowKey, rhs.flowKey)
                .append(this.triggerFlowKey, rhs.triggerFlowKey)
                .append(this.jsonMaping, rhs.jsonMaping)
                .append(this.note, rhs.note)
                .isEquals();
    }

    /**
     * @see Object#hashCode()
     */
    @Override
    public int hashCode()
    {
        return new HashCodeBuilder(-82280557, -700257973)
                .append(this.id)
                .append(this.name)
                .append(this.nodeId)
                .append(this.action)
                .append(this.flowKey)
                .append(this.triggerFlowKey)
                .append(this.jsonMaping)
                .append(this.note)
                .toHashCode();
    }

    /**
     * @see Object#toString()
     */
    @Override
    public String toString()
    {
        return new ToStringBuilder(this)
                .append("id", this.id)
                .append("name", this.name)
                .append("nodeId", this.nodeId)
                .append("action", this.action)
                .append("flowKey", this.flowKey)
                .append("triggerFlowKey", this.triggerFlowKey)
                .append("jsonMaping", this.jsonMaping)
                .append("desc", this.note)
                .toString();
    }



}
